package project.dbaccesslayer;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import project.model.adt.Question;

public class Table_SO_Questions {
	
	public static void saveQuestion(Connection conn, Question ques) throws SQLException {
		PreparedStatement s = conn.prepareStatement("INSERT INTO SO_Questions"
				+ "(Question_id,Asker_user_id,Title,Date_Asked,Votes,Descr) VALUES(?,?,?,?,?,?)");
		
		s.setLong(1, ques.id);
		s.setLong(2, ques.askerId);
		s.setString(3, ques.title);
		s.setLong(4, ques.dateAsked);
		s.setLong(5, ques.votes);
		s.setString(6, ques.description);

		s.execute();
	}
	
	
	
	

}
